//
//  HLReportRequest.m
//  YueYue
//
//  Created by hulu001 on 2023/5/18.
//

#import "HLReportRequest.h"

@implementation HLReportRequest
{
    NSDictionary *_params;
}

- (id)initWithParams:(NSDictionary *)params
{
    self = [super init];
    
    if (self) {
        _params = params;
    }
    
    return self;
}

- (id)initWithReason
{
    self = [super init];
    
    if (self) {
        _params = nil;
    }
    
    return self;
}

- (NSString *)requestUrl
{
    if (_params){
        return @"/jl_pf_report/insert";
    } else {
        return @"/jl_pf_report/report_class_config";
    }
    
}

- (YTKRequestMethod)requestMethod
{
    if (_params){
        return YTKRequestMethodPOST;
    }
    return YTKRequestMethodGET;
}

- (id)requestArgument
{
    if (_params){
        return _params;
    } else {
        return @{};
    }
}

- (BOOL)isReport
{
    return _params != nil;
}

- (NSArray <HLReportModel *> *)reasonList
{
    NSArray *lists = @[];
    NSArray *data = [self.result valueForKey:@"data"];
    if ([HLRunTime shareInstance].isFood){
        data = [self datas];
    }
    if (![data isKindOfClass:[NSArray class]]){
        return lists;
    }
    
    if (data.count > 0) {
       lists = [HLReportModel mj_objectArrayWithKeyValuesArray:data];
    }
    
    return lists;
}

- (NSArray <NSDictionary *> *)datas
{
    return @[
        @{
    @"cteTime": @"2023-08-08 17:08:29",
    @"cteUser": @"admin",
    @"delFlag": @"0",
    @"isActive": @"1",
    @"reportClassCode": @"0bd5fe23dc6f40ec9c8ea087b3151aa7",
    @"reportClassName": @"没有才艺",
    @"sex": @"1",
    @"sort": @"1",
    @"uteTime": @"2023-08-08 17:08:36",
    @"uteUser": @"admin",
    },
        @{
    @"cteTime": @"2023-01-11 17:07:31",
    @"cteUser": @"admin",
    @"delFlag": @"0",
    @"isActive": @"1",
    @"reportClassCode": @"8ac01b5ba50b4460a192376d3eb74601",
    @"reportClassName": @"诈骗",
    @"sex": @"1",
    @"sort": @"2",
    @"uteTime": @"2023-01-11 17:07:36",
    @"uteUser": @"admin",
},
        @{
    @"cteTime": @"2023-01-11 17:07:10",
    @"cteUser": @"admin",
    @"delFlag": @"0",
    @"isActive": @"1",
    @"reportClassCode": @"71a94fb6c0f24d7499c6184ad759590e",
    @"reportClassName": @"骚扰",
    @"sex": @"1",
    @"sort": @"3",
    @"uteTime": @"2023-01-11 17:07:15",
    @"uteUser": @"admin",
},
        @{
    @"cteTime": @"2023-01-11 17:07:31",
    @"cteUser": @"admin",
    @"delFlag": @"0",
    @"isActive": @"1",
    @"reportClassCode": @"31b2d77ed71a4b24b88397ba27ec73a5",
    @"reportClassName": @"辱骂",
    @"sex": @"1",
    @"sort": @"4",
    @"uteTime": @"2023-01-11 17:07:36",
    @"uteUser": @"admin",
},
        @{
    @"cteTime": @"2023-01-11 17:07:10",
    @"cteUser": @"admin",
    @"delFlag": @"0",
    @"isActive": @"1",
    @"reportClassCode": @"6d581c21cb144324b257b5d6abbc30d9",
    @"reportClassName": @"引导",
    @"sex": @"1",
    @"sort": @"5",
    @"uteTime": @"2023-01-11 17:07:15",
    @"uteUser": @"admin",
},
        @{
    @"cteTime": @"2023-01-11 17:07:31",
    @"cteUser": @"admin",
    @"delFlag": @"0",
    @"isActive": @"1",
    @"reportClassCode": @"2bd1ccd0213b4487a7ce5dc1239f1ac1",
    @"reportClassName": @"恶意挂断",
    @"sex": @"1",
    @"sort": @"6",
    @"uteTime": @"2023-01-11 17:07:36",
    @"uteUser": @"admin",
},
        @{
    @"cteTime": @"2023-06-12 09:14:39",
    @"cteUser": @"admin",
    @"delFlag": @"0",
    @"isActive": @"1",
    @"reportClassCode": @"7331f02ea93740688da6ca72cd9d228d",
    @"reportClassName": @"其它",
    @"sex": @"1",
    @"sort": @"7",
    @"uteTime": @"2023-06-12 09:14:45",
    @"uteUser": @"admin",
}
    ];
}

@end
